#ifndef GRAPHICS_BOUNDING_NODE_H
#define GRAPHICS_BOUNDING_NODE_H

#include "graphics/bounding_volume.h"
#include "graphics/camera.h"

#include "graphics/scene_node.h"


namespace graphics {

class BoundingNode : InternalNode {
public:
    BoundingNode(SceneNode * parent) : InternalNode(parent), volume_(NULL) {}
    BoundingNode(SceneNode * parent, const BoundingVolume * volume) : InternalNode(parent), volume_(volume) {}
    int Render(const Camera & camera)  {
        if(volume_) {
            if( camera_.Overlaps(volume_) )
                return InternalNode::Render(camera);
        }
    }

    const BoundingVolume * GetBoundingVolume() const { return volume_; }
    void SetBoundingVolume(BoundingVolume * volume) { volume_ = volume; }
private:
    BoundingVolume * volume_;
};

}

#endif 